
#ifndef  __FILELIST_H__
#define  __FILELIST_H__

//********************************************************************
#include "sys_cfg.h"
#include "sys_port.h"
#include "sys_printk.h"
//********************************************************************

typedef enum {
    SORT_TYPE_DEFAULT = 0,
    SORT_TYPE_NAME,
}sort_type_e;

typedef enum  {
    FILE_TYPE_DEFAULT = 0,
    FILE_TYPE_VIDEO,
    FILE_TYPE_MUSIC,
    FILE_TYPE_PHOTO,
    FILE_TYPE_TXT,
    FILE_TYPE_ALL,
}file_type_e;

typedef struct _fileinfo_t{
    int   type;
    char* dir;
    char* name;
}fileinfo_t;

typedef struct fileNode {
    fileinfo_t*      data;
    struct fileNode* next; 
} fileNode;


typedef struct _file_cfg_t{

    int   sort_type;
    int   search_type;
    
    char  dir[256];

    void  (*end_search_cb)(void* data);
}file_cfg_t;

typedef struct _filemanage_t{

    int        index;
    int        total;
    fileNode*  head;
    file_cfg_t cfg;

    void*      task_handle;
}filemanage_t;
//********************************************************************

int file_done_end_callback(void);

int file_search_everything(file_cfg_t* cfg);


#endif

